package com.aiguigu.sort;

public class HeapSort {
    public static void main(String[] args) {
    }

    public void HeapAdjust(int r [],int s,int m){
        int rc = r[s];
        for (int j = 2*s; j <=m ; j=j*2) {
            if (j<m&&r[j]<r[j+1])++j;
            if (rc>=r[j])break;
            r[s] = r[j];
            s=j;
        }
        r[s] = rc;
    }

}
